var names = ["anc","aca","ave","vwvw"]
//slice 只要传入start - end 对于同一个数组来说，会返回确定的值
//slice 函数是不会修改原来数组 纯函数
var newNames1 = names.slice(0,3)
console.log(newNames1)
console.log(names);

var newNames2 = names.splice(2);//从第二个位置开始截取
console.log(newNames2);
console.log(names);

var obj = {name:"why",age:11}
function test(info) {
    return{
        ...info,
        age:100
    }
}

test(obj)
test(obj)
test(obj)

var sum2 = x=>y=>z=>{return x+y+z}
var sum3 = x=>y=>z=>x+y+z;

console.log(sum3(1)(2)(4));


//柯里化
var logg = date => type => message =>{
    console.log(`[${date.getHours()}:${date.getMinutes()}][${type}]:[${message}]`)
}
var nowlog = logg(new Date());
nowlog("DEBUG")("查找");
nowlog("FETURE")("caca");

